const obj = "?word=vue&a=1"
  .slice(1)
  .split("&")
  .reduce((obj, item) => {
    console.log(item);
    const arr = item.split("=");
    // if (arr.length !== 2) return obj;
    obj[arr[0]] = arr[1];
    return obj;
  }, {});

console.log(obj);
